1. Field of the Invention
The present invention is generally directed to processing tasks that require access to limited resources.
2. Background Art
FIG. 1 illustrates a mobile workforce environment 102 that includes a server 106 and a number of mobile clients 110. Mobile clients 110 are part of a mobile workforce and must, from time to time, sync with an enterprise database 104.
Database 104 represents a limited resource because only a finite number of threads may interact with it at any given time. In other words, there is a maximum number of concurrent active connections to database 104 that may exist at any given time.
Server 106 may receive sync requests 108A-108N from multiple clients 110 at the same time. The number of such sync requests may exceed the number of allowed concurrent active connections to database 104. When this occurs, server 106 must efficiently process the sync requests and, in so doing, efficiently allocate database resources among the threads serving the sync requests. Otherwise, system performance will degrade.
There are a variety of prior art approaches for scheduling tasks and allocating/locking resources. These prior approaches are flawed for a number of reasons. For example, some approaches require a custom, non-generic task scheduler that must have knowledge of the tasks which it will enqueue/dequeue. Other approaches require a great number of threads. Still other approaches require internal queues that are owned by threads/jobs.
Accordingly, what is needed is an improved approach for processing tasks that require access to limited resources. More particularly, what is needed is an improved approach for assigning tasks to threads in a server process, where threads may require access to limited resources.